package com.wowudi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wowudi.service.HouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wowudi.mapper.BedMapper;
import com.wowudi.entity.Bed;
import com.wowudi.service.BedService;
@Service
public class BedServiceImpl extends ServiceImpl<BedMapper, Bed> implements BedService{

    @Autowired
    private BedMapper bedMapper;

    /**
    * Description: 根据病房id查询病床<br/>
    * date: 2022-3-30<br/>
    * @author 贺同志<br/>
    */
    @Override
    public List<Bed> findBedById(String id) {
        QueryWrapper<Bed> wrapper = new QueryWrapper<>();
        wrapper.eq("hih_card",id);
        List<Bed> bedList = bedMapper.selectList(wrapper);
        return bedList;
    }


    /**
    * Description: 新增病床<br/>
    * date: 2022-3-30<br/>
    * @author 贺同志<br/>
    */
    @Override
    public int addBed(Bed bed) {
        int i = bedMapper.insert(bed);
        return i;
    }
}
